/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <cstdio>
#include <vector>
using namespace std;

int main_1019_2()
{
    int N=0,b;
    bool flag=true;
    vector<int> Nb;
    scanf("%d%d",&N,&b);
    do
    {
        Nb.push_back(N%b);
        N/=b;
    }
    while (N);
    auto iter_end=--Nb.end();
    for (auto iter=Nb.begin(); iter!=iter_end; ++iter,--iter_end )
    {
        if (*iter!=*iter_end)
        {
            flag=false;
            break;
        }
    }
    if (flag)
    {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }
    for (auto iter=Nb.rbegin(); iter!=--Nb.rend(); ++iter )
    {
        printf("%d ",*iter);
    }
    printf("%d",*Nb.begin());
    return 0;
}
